#ifndef PICTURERENDER_2018
#define PICTURERENDER_2018

#include    "picture.h"


class PictureRender
{
protected:
	PictureRender(){ m_useTransparency = true; }
	virtual ~PictureRender(){}
	bool m_useTransparency;

public:
	virtual void update() = 0;

	virtual void render(GLfloat x,GLfloat y) = 0;
	void render(Point p){render(p.x,p.y);}

	bool getUseTransparency(){return m_useTransparency;}
	void setUseTransparency(bool transparency){m_useTransparency = transparency;}
};


class SinglePictureRender : public PictureRender
{
public:
	SinglePictureRender() : PictureRender(){m_picture = 0;}
    virtual ~SinglePictureRender() override{}

protected:
	SinglePicture* m_picture;

public:
	virtual void update()override {}
	virtual void render(GLfloat x,GLfloat y)override;

	void setSinglePicture(SinglePicture* picture){m_picture = picture;}
	SinglePicture* getSinglePicture(){return m_picture;}
};


class MultiPictureRender : public PictureRender
{
public:
	MultiPictureRender() : PictureRender()
	{
	    m_picture = 0;
	    m_currentPictureIndex = 0;
    }

    virtual ~MultiPictureRender() override{}

protected:
	MultiPicture*   m_picture;
	unsigned int    m_currentPictureIndex;

public:
	virtual void update() override;
	virtual void render(GLfloat x,GLfloat y) override;

	void setMultiPicture(MultiPicture* picture){m_picture = picture;}
	MultiPicture* getMultiPicture(){return m_picture;}
};


#endif // PICTURERENDER_2018
